<template>
	<view>
				<water-mask></water-mask>
		<!-- 订单列表 -->
		<view style=" display: flex;flex-direction: column;width: 100%;padding: 1rem;">
			<order-card v-for="(item,index) in orderList" :index="index" :totalAmount="item.omsOrder.totalAmount" :name="item.batch.name" :ifOpen="index==0?true:false"  :list="item" @delItem="delItem"></order-card>


		</view>
	</view>
</template>

<script>
		import {listOrder,getOrderProductList,updateOrderProducts,addOrderProducts} from '@/api/system/order.js';
	export default {
		data() {
			return {
				// 查询参数
				      queryParams: {
				        // pageNum: 1,
				        // pageSize: 10,
				        orderSn: null,
				        batchId: null,
						memberUsername:getApp().globalData.userInfo.nickName,
				        userId:getApp().globalData.userInfo.userId,
						deptId:getApp().globalData.userInfo.dept.deptId,
						deptName:getApp().globalData.userInfo.dept.deptName,
				        totalAmount: null,
				        purchasePrice: null,
				        status: null,
				        autoConfirmDay: null,
				        deleteStatus: null,
				        receiveTime: null,
				      },
					  orderList:[],
					ifOpen: true,
			};
		},
		onLoad() {
this.getOrder();
		},
		methods: {
			getOrder(){
				const queryParams= {
				  userId:getApp().globalData.userInfo.userId,
				}

				getOrderProductList(queryParams).then(res=>{

					this.orderList=res.data
				})

			},
			delItem(index){
				this.orderList.splice(index,1);
			},
		}
	}
</script>

<style lang="scss">
	
</style>